package org.pupil.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @Description: 获取ip地址
 * @Author: pupil
 * @Date: 2024/07/21 下午 1:49
 */
public class IpUtil {
    public static String getIP(){
        InetAddress inetAddress = null;
        try {
            inetAddress = InetAddress.getLocalHost();
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        return inetAddress.getHostAddress();
    }
}
